import 'package:fish_redux/fish_redux.dart';
import 'action.dart';
import 'state.dart';
import 'item/state.dart';
Effect<ListState> buildEffect() {
  return combineEffects(<Object, Effect<ListState>>{
    ListAction.action: _onAction,
    Lifecycle.initState: _onInit,
  });
}

void _onAction(Action action, Context<ListState> ctx) {
}

void _onInit(Action action, Context<ListState> ctx) {

  List<ItemState> mockData = [
    ItemState(
      type:0,
      title: "标题1",
      content: "展示文本展示文本展示文本展示文本",
    ),
    ItemState(
      type:0,
      title: "标题2",
      content: "展示文本展示文本展示文本",
    ),
    ItemState(
      type:0,
      title: "标题3",
      content: "展示文本展示文本展示文本",
    ),
    ItemState(
      type:0,
      title: "标题4",
      content: "展示文本展示文本展示文本展示文本展示文本展示文本展示文本展示文本展示文本展示文本",
    ),
  ];
  ctx.dispatch(ListActionCreator.initList(mockData));
}